package com.agricultural.robot.factory;

import com.agricultural.robot.model.*;

/**
 * 具体农机设备工厂 - 工厂方法模式
 */
public class ConcreteAgriculturalMachineFactory implements AgriculturalMachineFactory {
    @Override
    public AgriculturalMachine createMachine(MachineType type) {
        switch (type) {
            case PLANTER:
                return new Planter("播种机-" + System.currentTimeMillis());
            case SPRAYER:
                return new Sprayer("喷药机-" + System.currentTimeMillis());
            case HARVESTER:
                return new Harvester("收割机-" + System.currentTimeMillis());
            default:
                throw new IllegalArgumentException("不支持的农机类型: " + type);
        }
    }
}
